package editer.commands 
{
	import editer.views.UI;
	import editer.views.UIMediator;
	import flash.display.Sprite;
	import org.robotlegs.xxl.base.ContextSignal;
	import org.robotlegs.xxl.mvcs.Command;
	import org.xxl.iso.IsoWorld;
	
	/**
	 * ...
	 * @author XXL
	 */
	public class StartupCommand extends Command 
	{
		[Inject]
		public var type:String;
		
		override public function execute():void 
		{
			if (type == ContextSignal.STARTUP_COMPLETE)
			{
				var bgLayer:Sprite = new Sprite();
				injector.mapValue(Sprite, bgLayer, "bgLayer");
				var stats:Stats = new Stats();
				injector.mapValue(Stats, stats);
				var isoLayer:Sprite = new Sprite();
				injector.mapValue(Sprite, isoLayer, "isoLayer");
				mediatorMap.mapView(UI, UIMediator);
				
				contextView.addChild(bgLayer);
				contextView.addChild(isoLayer);
				contextView.addChild(new UI());
				contextView.addChild(stats);
				stats.y = 20;
			}
		}
		
	}

}